package main

import (
	//"fmt"
	//"./services"
	"fmt"
	"go-scripts/common"
	"reflect"
)

func main() {
	my := common.NewError("myerr", common.PageError)
	fmt.Println(reflect.TypeOf(my).String() == reflect.TypeOf(&common.Error{}).String())
	//redisService,err := services.GetRedisService()
	//mongo,err := common.GetMongo()
	//fmt.Println(mongo)
	//tmpInfo := mongo.GetMongoCollection("TmpInfo")
	//theme := mongo.GetMongoCollection("Theme")
	//fmt.Println(redisService)
	//fmt.Println(tmpInfo)
	//fmt.Println(theme)
	//if err != nil {
	//	panic(err)
	//}
	//res := common.BuildNodes(&common.Keyword{Force: []string{"aaa", "bbb"},  Similar: "ccc"})
	//for _,v := range res {
	//	fmt.Println(v)
	//}
	//fmt.Printf("main\n")
	////str := "招商银行涨了，工商银行也涨了，建设银行没涨"
	//for _,v := range common.MatchKeysFromString([]string{"招商银行", "工商银行"}, "招商银行涨了，工商银行也涨了，建设银行没有涨") {
	//	fmt.Println(v)
	//}
	//fmt.Println(common.MatchKeysFromString([]string{"招商银行", "工商银行"}, "招商银行涨了，工商银行也涨了，建设银行没有涨"))
	//tmpInfoDao,err := dao.NewTmpInfoDao()
	//if err != nil {
	//	panic(err)
	//}
	//tmpInfo := models.NewTmpInfo()
	//tmpInfoDao.FindOne(bson.M{
	//	"title": "A股冰火反差折射博弈新局",
	//}, bson.M{"title": 1, "url": 1}, tmpInfo)
	//fmt.Println(tmpInfo)
	//for _,v := range tmpInfos {
	//	fmt.Println(v.Id)
	//	fmt.Println(v.Title)
	//}
	//tmpInfoDao.Create(map[string]interface{}{
	//	"title": "大智慧",
	//})
	//dataRedis,err := common.GetRedisClient("data")
	//if err != nil {
	//	panic(err.Error())
	//}
	//fmt.Println(dataRedis)
	//setErr := dataRedis.Set("key", "value", 0).Err()
	//if setErr !=nil {
	//	panic(setErr.Error())
	//}
	//redisService,err := services.NewRedisService()
	//if err != nil {
	//	panic(err)
	//}
	////redisService.SetTest("testValue")
	//val :=redisService.GetTest()
	//fmt.Println(val == "")
	//env := os.Getenv("NODE_ENV")

	//files,err := ioutil.ReadDir("src/config")

	//file,err := os.Open("src/config/" + env + ".json")

	//configMap := make(map[string]map[string]map[string]string)
	//fileBytes,err := ioutil.ReadFile("src/config/" + env + ".json")
	//json.Unmarshal(fileBytes, &configMap)
	//fmt.Println(configMap["redis"]["data"]["Addr"])
	//redis,ok :=configMap["redis"]["data"].(config.Redis)
	//fmt.Println(err)
	//fmt.Println(redis)
	//fmt.Println(ok)
}